package com.ruoyi.web.core.config;

import com.github.wxpay.sdk.WXPayConfig;
import lombok.extern.slf4j.Slf4j;

import java.io.IOException;

/**
 * 天蛙小程序  哇米商户收款配置
 */
@Slf4j
public class WamiConfig extends WechatConfig {
    /**
     * 天蛙小程序appId
     */
    public static final String APPID = "wxd7b979afad21ae47";

    /**
     * 天蛙小程序密钥
     */
    public static final String SECRET = "7ec0b59e73b75b7388bd0323f1d29955";

    /**
     * 哇米商户号
     */
    public static final String MCHID = "1607299523";

    /**
     * 哇米商户密钥 --- 同 API V3 密钥
     */
    public static final String KEY = "15e1b4add0de56ff1c55f0519ab52793";

    /**
     * 哇米 API V3 秘钥
     */
    public static final String API_V3_KEY = "15e1b4add0de56ff1c55f0519ab52793";


    public static final String BODY = "智能物联";

    public static final  String DESC = "智能物联分润到账";

    /**
     * 哇米支付分充电宝服务号
     */
    public static final String SERVICE_ID = "00002000000000161579538960291447";

    /**
     * 支付分签名方式
     */
    public static final String SIGN_TYPE = "HMAC-SHA256";

    /**
     * 金额环回说明
     */
    public static final String REFUND_DESC = "智能物联，余额退还";

    /**
     * 哇米商户api证书序列号
     * https://myssl.com/cert_decode.html 证书解析地址
     */
    public static final String SERIAL_NO = "114DF078400DDB3BBAEEF4EAADA405EEBAC6CA7A";

    /**
     * 哇米证书内容  apiclient_key.pem文件中的内容 除去开头结尾行
     *  请求量大为节约资源直接拿出来
     */
    public static final String PRIVATE_CONTENT = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDEupcPZX6pEjYX" +
            "KH+xnlXOnLgepHpZfAXQRgx9QxpJDUTHJm7DHxri7jd7aHt0qw+o9quYBwdplpc/" +
            "MQgWfXkKvBeOiwrbTd1bPL+NP2DkcV9RHc+bkH3cOyp1ZQbIpbTYCeKsQXxSmPcr" +
            "IUDaaojWGO4TAKBHXDfrr/OGs5mN4EzoC6aPk2z8DW4eYsCGgkVr+M7j3QBc9xVc" +
            "9wt0ord49LejL1HeGaPdd2L1gIauIIsPQ99jKmw8qZaHTt25T6oXp/PFTrZcdDES" +
            "6zc6jzvfzUaiHtJvAfgjdyzsEN8NrUpkkcSvHhxVTGx0CAvjD30TQqfZq4cj0u4j" +
            "+WaekIiTAgMBAAECggEAAMJrpN6Sb5qnZM1+OLRQxnxqZYvjAQduilBK6gzhRBju" +
            "BArM8KnlE60xv6M2nsuuQsu4+9xDFhBDwzWwP036sqTpPl6hCxmw2hJQ9v2gpSEe" +
            "6hRAYexb4AbGci+SqCGjohXfrySNk1AN3DfDpVQ19QWhnacp9zyO5rUGLqXw2NBc" +
            "H+y8nLm1v9ciGsyoGus3H9y9GpC+SglRT3JnkrxDB0eDwmOwxdXIgo/qd40qMKc3" +
            "fvE7jfoUEOslRS3Nv22ECwhxaEiLriZCC6zu6pr2I1B9ACU/1BWHxk1QHY/cQmI+" +
            "4OW6YshVFP85TJ+vRkXv7FFIs5lZsbpBkOruekOqCQKBgQDmSmjKiMUR28I3m+IK" +
            "kpRqxKdMZF+SquqFAh/r5d1JwL6ADqq/0i7fNx+lwFNTJGmNCq+tA0mc3UXG54gV" +
            "3uQjIhu8egWLpClT7lB1tOFv1qEIUWxQ/k8IfTje/EsPqrbwZtRnzPw8HgcUb8zb" +
            "wHeAXONUviHmZTUjPrKPr1i7vwKBgQDasQBrPiHcFktEvnGhIiZ5b84ArCqacK0Z" +
            "MaSCk/9X7EdhKdFOu2rsxkqOMH1mUKOduvztWzC0DjoiRKJtkEmozpryw76UQvq6" +
            "zp40VDiuaa1xR1Zz8t2TvW1wd2LUMuTicoBdYOZQMun6EWbNBAYUvT7tBz93LfiQ" +
            "CDAtwYp4LQKBgQCNPOGcJdnHpCIvfNlbZp7EBKwefAjpqQ2AWdc+FJJtY1ryqwwp" +
            "7Tx2BhbQz23LNi/OItmvoK6LGGJtJR8fWr5MleSw6Z1xEVOPeD+8kR0aPGYy9c0a" +
            "t329VR+GEvHuP+NG+aoXp26jaD8rV44q0JX6Ef4SwTGFXlkCrrdQzFf9fQKBgAHa" +
            "9pHyWP8xATp4Eya2z3TAShMfYs0kn5NTJH4nG0d3rbNZU3lDhci0dfV229l+XaT8" +
            "7SBmYadlZ4Da7DXZv4Y7Gn1sw7UmTFJBZn4zKLfyFZKcdFNPgCm8taz6llAOjnqN" +
            "ViF0rP+JLwr8Es8ydYq/gEUqhpNQRIeUSjRZK/+RAoGBAIMtvRth81n2+rToEqR+" +
            "rg6t0s0G5adZgqnJNQhUmWH97mFT1JuKbFx2TX0Q/a2lYy3jOH+ANXj1hbsIkwl5" +
            "f/Jsw1avwveIzoWm2vAy/EI+gwkDXfb/PHgQJptiUnDEuvuF420Gm8yVFVhgD6kk" +
            "fF0oMawdvdPfasUq138FApc8";

    @Override
    public String getAppid() {
        return APPID;
    }

    @Override
    public String getSecret() {
        return SECRET;
    }

    @Override
    public String getMchId() {
        return MCHID;
    }

    @Override
    public String getKey() {
        return KEY;
    }

    @Override
    public String getApiV3Key() {
        return API_V3_KEY;
    }

    @Override
    public String getBody() {
        return BODY;
    }

    @Override
    public String getDesc() {
        return DESC;
    }

    @Override
    public String getServiceId() {
        return SERVICE_ID;
    }

    @Override
    public String getSignType() {
        return SIGN_TYPE;
    }

    @Override
    public String getRefundDesc() {
        return REFUND_DESC;
    }

    @Override
    public String getSerialNo() {
        return SERIAL_NO;
    }

    @Override
    public String getPrivateContent() {
        return PRIVATE_CONTENT;
    }

    @Override
    public WXPayConfig getWXPayConfig() {
        try {
            return new WamiPayConfig();
        } catch (IOException e) {
            log.error("【error】：哇米商户配置文件初始化失败" +e.getMessage(), e);
        }
        return null;
    }
}
